﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List<Form_Execute_Operator> dd = new List<WpfApplication1.Form_Execute_Operator>();
            for (int i = 0; i < 10; i++)
            {
                dd.Add(new WpfApplication1.Form_Execute_Operator()
                {
                    Success = i
                     ,
                    Error = i
                     ,
                    Warning = i
                });
            }
            gridProcess.ItemsSource = dd;
        }
    }

    public class Form_Execute_Operator
    {
        public Form_Execute_Operator()
        {

        }

        public Form_Execute_Operator(string name)
        {
            Name = name;
        }

        public const string INIT_SETTING = "正在检查设置";

        public const string INIT_Connection = "正在初始化连接";

        public const string INIT_SQL = "设置SQL命令";
        

        public Form_Execute_StatusType Status { get; set; } = Form_Execute_StatusType.等待运行;

        public String StatusText { get { return Status.ToString(); } }

        public string Message { get; set; }

        public string Name { get; set; }

        public int Error { get; set; }

        public int Warning { get; set; }

        public int Success { get; set; }

        /// <summary>
        /// 删除行数
        /// </summary>
        public int DeletedCount { get; set; }

        /// <summary>
        /// 添加行数
        /// </summary>
        public int InsertCount { get; set; }

        /// <summary>
        /// 更新行数
        /// </summary>
        public int UpdateCount { get; set; }
    }
    public class Form_Execute_Status
    {
        public Form_Execute_Status()
        {
        }

        public Form_Execute_StatusType Status { get; set; }

        public string StatusText
        {
            get
            {
                return Status.ToString();
            }
        }

        public int Total { get; set; }

        public int Successed { get; set; }

        public int Warning { get; set; }

        public int Error { get; set; }
        
    }
    public enum Form_Execute_StatusType : int
    {
        运行中
            ,
        错误
            ,
        已停止
            ,
        运行成功
           ,
        等待运行
    }
}
